package demo.spring.aop;

import demo.spring.aop.test.AopDemo;
import demo.spring.aop.test.AopDemoImplA;
import demo.spring.aop.test.AopDemoImplB;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by lushun.chen on 2017/3/24.
 *
 * @author lushun.chen
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx =
                new ClassPathXmlApplicationContext("services.xml");
        AopDemo a = (AopDemo) ctx.getBean("aopDemo1", AopDemoImplA.class);
        a.printHelloWorld();
//        a.doPrint();
        AopDemo b = (AopDemo) ctx.getBean("aopDemo2", AopDemoImplB.class);
        b.printHelloWorld();
//        b.doPrint();
    }
}
